package Controller;

import Behavior.PlaneShoot;
import Factory.ApacheFactory;
import Factory.BoeingFactory;
import Factory.KongkeFactory;
import Impl.PlaneFactory;
import Impl.Scene;
import Model.*;
public class SceneFive implements Scene {
    @Override
    public void SceneSimu() throws InterruptedException {
        System.out.println("-----------SCENE 3------------");
        // 使用工厂模式create 2 planes
        PlaneFactory apacheFac = new ApacheFactory();
        PlaneFactory boeingFac = new BoeingFactory();
        Plane apache = apacheFac.createPlane();
        Plane boeing = boeingFac.createPlane();
        apache.display();
        boeing.display();
        System.out.println("Flying Show time");Thread.sleep(2000);
        // 同样使用工厂模式创建一架敌机，假设是新增的空客飞机
        System.out.println("敌机出现");
        PlaneFactory kongkeFac = new KongkeFactory();
        Plane kongke = kongkeFac.createPlane();
        kongke.display();Thread.sleep(2000);
        // apache plane进行射击动作，使用策略模式为其设置shoot behavior
        System.out.println("apache plane进行射击动作");
        apache.setShootBehavior(new PlaneShoot());
        apache.performShoot(kongke);Thread.sleep(2000);
        System.out.println("检验敌机状态");
        kongke.display();
        kongke.getState();Thread.sleep(5000);
    }
}
